﻿using MindASPCoreWebAPI.DtoModel.Common;
using MindASPCoreWebAPI.DtoModel.SystemManager;
using MindASPCoreWebAPI.PoModel.SystemManager;
using MindASPCoreWebAPI.Repository.SystemManager;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MindASPCoreWebAPI.Service.SystemManager
{
    public class ActivityService
    {
        public ActivityRepository _activityRepository;
        public ActivityService(ActivityRepository activityRepository)
        {
            _activityRepository = activityRepository;
        }
        public PagerResult<ActivityDto> ActivityShow(string acti_name, int? type_id, int? actiarea_id,
            string acti_priname, DateTime? minacti_time, DateTime? maxacti_time, int pageindex, int pagesize)
        {
            try
            {
                var list = _activityRepository.ActivityShow(acti_name, type_id, actiarea_id, 
                    acti_priname, minacti_time, maxacti_time, pageindex, pagesize);
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }

        public List<ActiareaModel> ActiareaList()
        {
            try
            {
                var list = _activityRepository.ActiareaList();
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }

        public List<TypeModel> TypeList()
        {
            try
            {
                var list = _activityRepository.TypeList();
                return list;

            }
            catch (Exception)
            {

                throw;
            }
        }

        public int ActivityAdd(ActivityAdminModel activityAdminModel)
        {
            try
            {
                var list = _activityRepository.ActivityAdd(activityAdminModel);
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }

        public ActivityAdminModel ActivityUpdate(int acti_id)
        {
            try
            {
                var list = _activityRepository.ActivityUpdate(acti_id);
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public int ActivityEdit(ActivityAdminModel activityAdminModel)
        {
            try
            {
                var list = _activityRepository.ActivityEdit(activityAdminModel);
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public int ActivityDelete(int acti_id)
        {
            try
            {
                var list = _activityRepository.ActivityDelete(acti_id);
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<IndustryAdminModel> IndustryAdminList()
        {
            try
            {
                var list = _activityRepository.IndustryAdminList();
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }

        public List<KaModel> KaList()
        {
            try
            {
                var list = _activityRepository.KaList();
                return list;
            }
            catch (Exception)
            {

                throw;
            }

        }
        public List<LangModel> LangList()
        {
            try
            {
                var list = _activityRepository.LangList();
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<HomePage> DiJia()
        {
            try
            {
                var list = _activityRepository.DiJia();
                return list;
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
